<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<title>编辑奖品设置</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">
			$(function() {
				//初始化表单验证
				$("#inputForm").initValidform();
			});
		</script>
		<style type="text/css">
			.section-head{text-align: center;font-size: 20px;color:#00C5CD;}
			.section-head-input{width:100px;height: 30px;font-size: 20px;}
			
			.section-to{height: 35px;width:100%;text-align: center; }
			.section-to .input-left{text-align: left; padding-left:30%;width: 35%; height: 0%;color: red;font-size: 20px;}
			.section-to .input-right{text-align: left ;width: 35%;padding-left:60%; height: 0%;color: red;font-size: 20px;}
			.section-to .center{text-align: left; padding-left:50%; width: 30%;height: 0%;font-size: 30px;color:red;}
			.section-to input{font-size: 10px;}
		</style>		
	</head>
	
	<body class="mainbody">
		<sys:message content="${message}"/>
		<form:form id="inputForm" modelAttribute="section" action="${ctx}/sd/section/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<fmt:formatDate value="${section.startOn }" pattern="yyyy-MM-dd HH:mm" var="start"/>
			<fmt:formatDate value="${section.endOn }" pattern="yyyy-MM-dd HH:mm" var="end"/>
			<!--导航栏-->
			<div class="location">
				<a href="${ctx}/sd/section/list" class="back"><i></i><span>返回列表页</span></a>
				<a href="${ctx}/center" class="home"><i></i><span>首页</span></a> 
				<i class="arrow"></i> 
				<a href="${ctx}/sd/section/"><span>奖品设置</span></a>
				<%-- <shiro:hasPermission name="sd:section:edit"> --%>
				<i class="arrow"></i><span>${not empty section.id ? '修改':'添加' }奖品设置</span>
				<%-- </shiro:hasPermission> --%>
			</div>	
			<div class="line10"></div>
			<!--/导航栏-->
	
			<!--内容-->
			<div id="floatHead" class="content-tab-wrap">
				<div class="content-tab">
					<div class="content-tab-ul-wrap">
						<ul>
							<li><a class="selected" href="javascript:;">奖品设置信息</a></li>
						</ul>
					</div>
				</div>
			</div>
			
			<div class="tab-content">
				<div class="section-head">
					<p style="font-family: 楷体;">抽奖名称:&nbsp;&nbsp;<form:input path="name" placeholder="如:xxxx抽奖第x阶段" cssClass="input" htmlEscape="false" maxlength="50" class="section-head-input" datatype="*" nullmsg="请输入抽奖名称" sumsg=" "/></p>
				</div>
				<br/><br/>
				<h3 style="text-align: center; font-size: 18px ;color: #468dbd">时间段</h3>
				<br/>
				<div class="section-to"  >
					<div class="input-left" >
						<p>从<form:input path="startOn" value="${start }"  placeholder="起始时间" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm' });"  cssClass="input" htmlEscape="false" maxlength="50"  class="required" datatype="*" nullmsg="请输入起始时间" sumsg=" "  /></p>
					</div>
					<div class="center">
						<h2>⇨</h2>
					</div>
					<div class="input-right " >
						<p><form:input path="endOn" value="${end }" placeholder="结束时间"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm' });" cssClass="input" htmlEscape="false" maxlength="50"  class="required" datatype="*" nullmsg="请输入结束时间" sumsg=" "  />止</p>
					</div>
				</div>
				<br/><br/>
				<div align="center">
				<hr color="#468dbd" width="75%"  />
				<br/>
				<h3 style="margin-left: -32px;" >总体概率</h3>
				<form:input class="input" style="position: relative;margin-top: -26px;margin-left: 225px;" path= "globalRate" />
					<table class="border-table" style="text-align: center">
						<thead>
							<tr>
							<th width="80px">奖品编号</th>
							<th width="200px">奖品名称</th>
							<th>积分抽奖(数字)</th>
							<th>分享抽奖</th>							
							<th>中奖概率</th>
							<th>积分中奖</th>	
							<th>分享中奖</th>
							<th>中奖总数</th>		
							<th>库存</th>												
<!-- 							<th>伪库存</th>
							<th>真库存</th> -->
							<th>奖品总数</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${awards}" var="award">
								<tr>
								<td>${award.id }</td>
								<td>${award.name }</td>
								<td><form:input  class="input" path="awardnums" datatype="/^\d/" value="${not empty award.sectionNum ? award.sectionNum:0}"/></td>
								<td>${award.shareNum}</td>			
								<td>${award.rate }</td>
								<td>${award.sectionDrawAward}</td>	
								<td>${award.sectionDistributed-award.sectionDrawAward}</td>
								<td>${award.sectionDistributed}</td>		
								<td>${award.stock}</td>														
<%-- 								<td>${award.stock}</td>
								<td>${award.realStock}</td> --%>
								<td>${award.amount}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
			<!--/内容-->
	
			<!--工具栏-->
			<div class="page-footer">
				<div class="btn-wrap">
					<shiro:hasPermission name="sd:section:edit">
						<input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" /> 
					</shiro:hasPermission>
					<input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
				</div>
			</div>
			<!--/工具栏-->
		</form:form>
	</body>
</html>

